<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    <!--  数组解构赋值-->
    let arr = [1, 2, 3]
    let [x, y, z] = arr
    console.log(x)
    console.log(y)
    console.log(z)

    let arr2 = [4, 5, 6]

    // arr  arr2 中的元素合并在一个数组中
    let arr3 = [...arr, ...arr2]
    console.log(arr3)

    let person = {
        name: 'tom',
        age: '20',
        sex: '男'
    }

    // 获取对象中的属性值
    // let name = person.name
    // let age = person.age
    // let sex = person.sex

    // 对象解构赋值
    let {name:pname,age,sex} = person
    console.log(pname)
    console.log(age)
    console.log(sex)

</script>


</body>
</html>